
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
# @file   : pwd_strength.py
# @author : weichy
# @date   : 2019/01/05
# @version: 1.0
# @desc   :  1.0通过计算机程序模拟掷骰子，一个骰子
            
'''



import random   

def roll_dice():
    '''
    模拟掷骰子
    '''
    roll = random.randint(1,6)
    return roll

def main():
    total_times = 10000
    # 初始化列表[00000]
    result_list = [0] * 6
    for i in range(total_times):
        roll = roll_dice()
        for j in range(1,7):
            if roll == j:
                result_list[j-1] += 1
    for i,result in enumerate(result_list):
        print('点数{}的次数：{}，频率为：{}。'.format(i+1,result,result/total_times))
  


if __name__ == '__main__':
    main()
